<html>

	<head>
	
	
		<script type="text/javascript" src=" https://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js"></script>
		<script language="javascript" src="../js/AjaxUpload.2.0.min.js"></script>
		<script language="javascript" src="../js/jquery.MultiFile.pack.js"></script>
		<script language="javascript">
		
			$(document).ready(function(){
			
				$('#upload_button').mouseover(function(){
					var tidad = $('#can').val();
					
				});
				var button = $('#upload_button'), interval;
				new AjaxUpload('#upload_button', {
					action: 'upload.php?id=5',
					onSubmit : function(file , ext){
					if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
						// extensiones permitidas
						alert('Error: Solo se permiten imagenes');
						// cancela upload
						return false;
					} else {
					
						button.text('Uploading');
						this.disable();
					}
					},
					onComplete: function(file, response){
						button.text('Upload');
						// enable upload button
						this.enable();			
						
					}	
				});
				
				
			});
		</script>
		<script language="javascript">
		$(document).ready(function(){
			
			
			$("#chequear").click(function(){
				var tidad = $("#can").val();
				alert(tidad);
				
			});
			
			
		});
		</script>
	
	</head>
	
	<body>
	
<?php

	$accion = $_GET['accion'];

	if ($accion == 'nuevo') {

		echo "
		
		<div id='titulo'>Crear Proveedor</div>

<div id='contenedor12'>
			<form action='insnuevoproveedor.php' method='POST'>
			
			<div id='contenedor13'>Id Proveedor:</div>
			<div id='contenedor14'><input type='text' name='id' size=20 readonly='readonly' placeholder='Campo Autonumerico'></div>

			<div id='contenedor13'>Nombre:</div>
			<div id='contenedor14'><input type='text' name='nombre' size=20 required autofocus>*</div>

			<div id='contenedor13'>Pais:</div>
			<div id='contenedor14'><input type='text' name='pais' size=15 required>*</div>

			<div id='contenedor13'>Web:</div>
			<div id='contenedor14'><input id='talla' type='text' name='web' size=70 placeholder='http://www.nombreweb.com'>*</div>

			<div id='contenedor13'>Telefono:</div>
			<div id='contenedor14'><input type='text' name='telefono'></div>


			<div id='contenedor13'></div>
			<div id='contenedor14'><input type='submit' value='Guardar'></div>

			</form>
			
			<div id='contenedor13'></div>
			<div id='contenedor14'>* Campo Obligatorio</div>
		</div>


	";

	}
	
//****************************************************************************************************************************************************************//
//********************************************************************   MODIFICAR ARTICULO   ********************************************************************//
//****************************************************************************************************************************************************************//
	
	
		$accion = $_GET['accion'];

	if ($accion == 'modificar') {
	
		$artsel = $_GET['id'];
		
		$conexion = mysql_connect($servidor,$usuario,$clave);
		mysql_select_db($bd,$conexion);

		$peticion = mysql_query("SELECT * FROM proveedores WHERE id=$artsel");
		
		while ($fila = mysql_fetch_array($peticion)){

		echo "
		
		<div id='titulo'>Crear Proveedor</div>

<div id='contenedor12'>
			<form action='actualizarproveedor.php' method='POST'>
			
			<div id='contenedor13'>Id Proveedor:</div>
			<div id='contenedor14'><input type='text' name='id' size=20 readonly='readonly' value=".$fila['id']."></div>

			<div id='contenedor13'>Nombre:</div>
			<div id='contenedor14'><input type='text' name='nombre' size=20 required value=".$fila['nombre'].">*</div>

			<div id='contenedor13'>Pais:</div>
			<div id='contenedor14'><input type='text' name='pais' size=15 required value=".$fila['pais'].">*</div>

			<div id='contenedor13'>Web:</div>
			<div id='contenedor14'><input id='talla' type='text' name='web' size=70 value=".$fila['web'].">*</div>

			<div id='contenedor13'>Telefono:</div>
			<div id='contenedor14'><input type='text' name='telefono' value=".$fila['telefono']."></div>


			<div id='contenedor13'></div>
			<div id='contenedor14'><input type='submit' value='Guardar'></div>

			</form>
			
			<div id='contenedor13'></div>
			<div id='contenedor14'>* Campo Obligatorio</div>
		</div>


	";

	}
	}
	

?>


</body>
	</html>	
	
